package com.ruoyi.system.service.impl;

import java.util.List;

import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.OrgOrgsMapper;
import com.ruoyi.system.domain.OrgOrgs;
import com.ruoyi.system.service.IOrgOrgsService;
import com.ruoyi.common.core.text.Convert;

/**
 * yonbip组织Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-09-05
 */
@Service
public class OrgOrgsServiceImpl implements IOrgOrgsService 
{
    @Autowired
    private OrgOrgsMapper orgOrgsMapper;

    /**
     * 查询yonbip组织
     * 
     * @param pkOrg yonbip组织主键
     * @return yonbip组织
     */
    @DataSource(DataSourceType.SLAVE)
    @Override
    public OrgOrgs selectOrgOrgsByPkOrg(String pkOrg)
    {
        return orgOrgsMapper.selectOrgOrgsByPkOrg(pkOrg);
    }

    /**
     * 查询yonbip组织列表
     * 
     * @param orgOrgs yonbip组织
     * @return yonbip组织
     */
    @DataSource(DataSourceType.SLAVE)
    @Override
    public List<OrgOrgs> selectOrgOrgsList(OrgOrgs orgOrgs)
    {
        return orgOrgsMapper.selectOrgOrgsList(orgOrgs);
    }

    /**
     * 新增yonbip组织
     * 
     * @param orgOrgs yonbip组织
     * @return 结果
     */
    @Override
    public int insertOrgOrgs(OrgOrgs orgOrgs)
    {
        return orgOrgsMapper.insertOrgOrgs(orgOrgs);
    }

    /**
     * 修改yonbip组织
     * 
     * @param orgOrgs yonbip组织
     * @return 结果
     */
    @Override
    public int updateOrgOrgs(OrgOrgs orgOrgs)
    {
        return orgOrgsMapper.updateOrgOrgs(orgOrgs);
    }

    /**
     * 批量删除yonbip组织
     * 
     * @param pkOrgs 需要删除的yonbip组织主键
     * @return 结果
     */
    @Override
    public int deleteOrgOrgsByPkOrgs(String pkOrgs)
    {
        return orgOrgsMapper.deleteOrgOrgsByPkOrgs(Convert.toStrArray(pkOrgs));
    }

    /**
     * 删除yonbip组织信息
     * 
     * @param pkOrg yonbip组织主键
     * @return 结果
     */
    @Override
    public int deleteOrgOrgsByPkOrg(String pkOrg)
    {
        return orgOrgsMapper.deleteOrgOrgsByPkOrg(pkOrg);
    }
}
